<?php

/**
 * LoginForm class.
 * LoginForm is the data structure for keeping
 * user login form data. It is used by the 'login' action of 'SiteController'.
 */
class SearchForm extends CFormModel
{
	public $name;
    public $sportType;
    public $date;
	public $startTime;
	public $endTime;

	/**
	 * Declares the validation rules.
	 * The rules state that username and password are required,
	 * and password needs to be authenticated.
	 */
	public function rules()
	{
		return array(
            array('name', 'length', 'max'=>45),
            array('sportType', 'numerical', 'integerOnly'=>true),
			array('date', 'date', 'format'=>'yyyy-M-d'),
			array('startTime', 'date', 'format'=>'H:m:s'),
			array('endTime', 'date', 'format'=>'H:m:s'),
		);
	}

	/**
	 * Declares attribute labels.
	 */
	public function attributeLabels()
	{
		return array(
            'name'=>Yii::t('site', 'Name'),
            'sportType'=>Yii::t('site', 'Sport Type'),
            'date'=>Yii::t('site', 'Date'),
            'startTime'=>Yii::t('site', 'Start Time'),
			'endTime'=>Yii::t('site', 'End Time'),
		);
	}
}
